package com.bilubi.reggie.reggie.utils;

import java.util.Random;

public class VerificationCodeUtil {

    static Random random;

    static {
        random = new Random();
    }

    public static String generateCode(){
        String source = "1234567890abcdefghijklmnopqrstuvwxwzABCDEFGHIJKLMNOPQRSTUVWXYZ";
        int length = source.length();
        StringBuilder code = new StringBuilder();
        for (int i = 0; i < 6; i++) {
            int index = random.nextInt(length);
            code.append(source.charAt(index));
        }
        return code.toString();
    }

}
